<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
    <style>
        .yz {
            text-align: left !important;
            margin-left: 20px;
        }

        .yz :before {
            font-family: iconfont;
            font-style: inherit;
            padding: 0 5px;
            font-size: 14px;
            content: "\E60D";
        }
    </style>
</head>
<body>
<div id="app" class="verifyPwd">
    <include file="./public/header.html"/>
    <form action="{:U('Users/verifySafePwd')}" method="post" id="form">
        <input type="hidden" name="id" id="uid" value="{$id}">

        <div class="container notSign fix pt15" s="[object Object]">
            <div class="userRight">
                <div class="userMain mgb10">
                    <ul class="queue">
                        <li class="right"><span>选择验证方式</span><i></i></li>
                        <li class="now"><span>验证安全密码</span><i></i></li>
                        <li><span>设置密码</span><i></i></li>
                        <li style="width: 50px"><span>完成</span><i></i></li>
                    </ul>
                    <ul class="submitContent mglr30 mgt15">
                        <form>
                            <li>
                                <span>原安全密码：</span>
                                <input tag="原安全密码" regmsg="密码应为6-16位字符" type="password" name="pass" id="pass"
                                       autocomplete="off" class="userInput"><span class="yz"
                                                                                  style="width: 300px"></span>
                            </li>
                            <li><span></span> <a style="margin-left: 60px" class="submitBtn ClickShade" onclick="sav()">确定</a>
                            </li>
                        </form>
                    </ul>
                </div>
            </div>
        </div>
    </form>
    <include file="./public/footer.html"/>
</div>


<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
    $(function () {
        personalInfo();
    })
    //验证原密码
    function sav() {
        var id = $("#uid").val();
        var pass = $("#pass").val();
        if (pass == '') {
            $(".yz").html("<font color='red'>原安全密码不能为空</font>");
            return false;
        } else {
            $(".yz").html("");
        }

        $.ajax({
            type: "POST",
            url: "{:U('Index/verifySafePwd')}",
            data: {'pass': pass, 'id': id},
            dataType: "json",
            success: function (data) {
                if (data == 1) {
                    $(".yz").html("<font color='red'>原安全密码输入不正确，请重新输入!</font>");
                    return false;
                } else if (data == 0) {
                    window.location.href = "/Index/verifyPwd2/id/"+id;
                }
            }
        });

    }
</script>
</body>
</html>